package ar.edu.unq.wannaplay.pages.employee;

import ar.edu.unq.wannaplay.dtos.EmployeeDTO;
import ar.edu.unq.wannaplay.pages.WPPage;
import ar.edu.unq.wannaplay.panels.employee.EditEmployeePanel;
import ar.edu.unq.wannaplay.services.EmployeeService;
import ar.edu.unq.wannaplay.utils.EmployeeEditer;

public class EditEmployeePage extends WPPage {

    private EmployeeEditer modelObject;

    private EmployeeService service;

    public EditEmployeePage(final EmployeeDTO modelObject, final EmployeeService service) {
        super("Edit Employee Page");
        this.modelObject = new EmployeeEditer(modelObject);
        this.service = service;
        this.initialize();
    }

    public EditEmployeePage(final EmployeeEditer modelObject, final EmployeeService service, final String pageName) {
        super(pageName);
        this.modelObject = modelObject;
        this.service = service;
        this.initialize();
    }

    public EditEmployeePage(final EmployeeEditer modelObject, final EmployeeService service) {
        super("Edit Employee Page");
        this.modelObject = modelObject;
        this.service = service;
        this.initialize();
    }

    @Override
    protected void addMainContent() {
        EditEmployeePanel panel = new EditEmployeePanel("mainContent", modelObject, service, this.getFeedBackPanel());
        this.add(panel);
    }

    public EmployeeEditer getModelObject() {
        return modelObject;
    }

    public void setModelObject(final EmployeeEditer modelObject) {
        this.modelObject = modelObject;
    }

    public EmployeeService getService() {
        return service;
    }

    public void setService(final EmployeeService service) {
        this.service = service;
    }

}
